/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is Forte for Java, Community Edition. The Initial * Developer of the Original Code is Sun Microsystems, Inc. Portions * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved. */ package org.netbeans.modules.editor.java; import java.awt.GridBagConstraints; import java.awt.Insets; import java.util.ResourceBundle; import org.openide.util.NbBundle; import org.openide.util.HelpCtx; /** * * @author Miloslav Metelka * @version 1.0 */ public class JCProviderPanel extends javax.swing.JPanel { String BUNDLE_DB_PREFIX = "JC_db_prefix"; // NOI18N String BUNDLE_TOOLTIP = "JC_title_tooltip"; // NOI18N String BUNDLE_STORAGE_LEVELS = "JC_storage_levels"; // NOI18N String BUNDLE_CLASS_LEVEL = "JC_class_level"; // NOI18N String BUNDLE_FIELD_LEVEL = "JC_field_level"; // NOI18N String BUNDLE_METHOD_LEVEL = "JC_method_level"; // NOI18N private static ResourceBundle bundle; private JCLevelPanel classLevel; private JCLevelPanel fieldLevel; private JCLevelPanel methodLevel; static final long serialVersionUID =1588903994175008478L; /** Creates new form JCProviderPanel */ public JCProviderPanel() { initComponents (); titleLabel.setText(getBundleString(BUNDLE_DB_PREFIX) + ":"); // NOI18N titleLabel.setToolTipText(getBundleString(BUNDLE_TOOLTIP)); namePrefix.setToolTipText(getBundleString(BUNDLE_TOOLTIP)); classLevel = new JCLevelPanel(getBundleString(BUNDLE_CLASS_LEVEL)); fieldLevel = new JCLevelPanel(getBundleString(BUNDLE_FIELD_LEVEL)); methodLevel = new JCLevelPanel(getBundleString(BUNDLE_METHOD_LEVEL)); GridBagConstraints gbc = new GridBagConstraints(); gbc.insets = new Insets(5, 15, 10, 15); levelPanel.add(classLevel, gbc); levelPanel.add(fieldLevel, gbc); levelPanel.add(methodLevel, gbc); HelpCtx.setHelpIDString (this, JCProviderPanel.class.getName ()); } public String getNamePrefix() { return namePrefix.getText(); } public void setNamePrefix(String s) { namePrefix.setText(s); } public int getClassLevel() { return classLevel.getLevel(); } public int getFieldLevel() { return fieldLevel.getLevel(); } public int getMethodLevel() { return methodLevel.getLevel(); } public void setClassLevel(int level) { classLevel.setLevel(level); } public void setFieldLevel(int level) { fieldLevel.setLevel(level); } public void setMethodLevel(int level) { methodLevel.setLevel(level); } String getBundleString(String s) { if (bundle == null) { bundle = NbBundle.getBundle(JCProviderPanel.class); } return bundle.getString(s); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the FormEditor. */ private void initComponents () {//GEN-BEGIN:initComponents setLayout (new java.awt.BorderLayout ()); setBorder (new javax.swing.border.EmptyBorder(new java.awt.Insets(8, 8, 8, 8))); titlePanel = new javax.swing.JPanel (); titlePanel.setLayout (new java.awt.GridBagLayout ()); java.awt.GridBagConstraints gridBagConstraints1; titlePanel.setBorder (new javax.swing.border.EmptyBorder(new java.awt.Insets(10, 0, 20, 0))); titleLabel = new javax.swing.JLabel (); titleLabel.setBorder (null); titleLabel.setText ("Parser Database File Prefix:"); // NOI18N gridBagConstraints1 = new java.awt.GridBagConstraints (); gridBagConstraints1.insets = new java.awt.Insets (0, 5, 0, 10); titlePanel.add (titleLabel, gridBagConstraints1); namePrefix = new javax.swing.JTextField (); namePrefix.setText ("pd_prefix"); // NOI18N gridBagConstraints1 = new java.awt.GridBagConstraints (); gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints1.weightx = 0.2; titlePanel.add (namePrefix, gridBagConstraints1); titleFillPanel = new javax.swing.JPanel (); titleFillPanel.setLayout (new java.awt.FlowLayout ()); gridBagConstraints1 = new java.awt.GridBagConstraints (); gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints1.weightx = 0.8; titlePanel.add (titleFillPanel, gridBagConstraints1); add (titlePanel, "North"); // NOI18N levelPanel = new javax.swing.JPanel (); levelPanel.setLayout (new java.awt.GridBagLayout ()); java.awt.GridBagConstraints gridBagConstraints2; levelPanel.setBorder (new javax.swing.border.TitledBorder("Storage Levels")); // NOI18N add (levelPanel, "Center"); // NOI18N }//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JPanel titlePanel; private javax.swing.JLabel titleLabel; private javax.swing.JTextField namePrefix; private javax.swing.JPanel titleFillPanel; private javax.swing.JPanel levelPanel; // End of variables declaration//GEN-END:variables } /* * Log * 7 Gandalf 1.6 1/14/00 Miloslav Metelka Localization * 6 Gandalf 1.5 1/13/00 Miloslav Metelka Localization * 5 Gandalf 1.4 1/12/00 Jesse Glick Context help. * 4 Gandalf 1.3 10/23/99 Ian Formanek NO SEMANTIC CHANGE - Sun * Microsystems Copyright in File Comment * 3 Gandalf 1.2 9/15/99 Miloslav Metelka * 2 Gandalf 1.1 8/9/99 Ian Formanek Generated Serial Version * UID * 1 Gandalf 1.0 7/20/99 Miloslav Metelka * $ */